<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>金字塔</title>
    <style>
       *{
            font-family: cursive;
        }
    </style>
</head>
<body>
<script>
    var num=prompt("请输入您想要的行数");
    for(var i=0;i <num;i++){
        var nbsp=num-i-1;
        for(var j=0;j<nbsp;j++){
            document.write("&nbsp;");
        }
        var stra=(i+1)*2-1;
        for(var k=0;k<stra;k++){
            document.write("*");
        }
        document.write("<br/>");
    }
</script>
</body>
</html>